# Makefile 4.0
obj-m := shyper.o
shyper-objs := src/shyper_service.o \
				src/ivc.o src/irq.o \
				src/hvc.o src/sys.o \
				src/hvc_call.o src/util.o \
				src/shyper_handler.o src/device_register.o \
				src/blk.o src/config.o src/unilib.o
ccflags-y := -std=gnu99 -Wno-declaration-after-statement

# Error messages from gcc will be muted if we omit an explicit definition to CC.
CC := ${CROSS_COMPILE}gcc

CURRENT_PATH := $(shell pwd)

# native
LINUX_KERNEL_PATH ?= /lib/modules/$(shell uname -r)/build

.PHONY: all module clean

all: module

module:
	make -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH) modules

clean:
	make -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH) clean
